TWiki . EBR . EbrGateway

Table Of Contents

Introduction

An EbrGateway is a software component that sits between the EbrNetwork and a DataSource.

The EbrGateway must perform the conversion between EbrMessages and the data format expected by its information source by operating one or more EbrServices. It must also return the data from the information source back into the EbrNetwork in the EbrMessage format.

To add a EbrService, see AddingAService, replacing references to "Node" with "Gateway" where appopriate.

Code for a sample EbrGateway is available in the CoreSoftware distribution.

TIP - NOTE: If the LocalServices deployment method is chosen then the NationalGatewayNode EbrNode can be used as a simple solution insteading of developing a custom EbrGateway.

Developing A Custom Gateway

Advanced EbrDevelopers who wish to write their own EbrGateway to handle EbrServices instead of embedding Services within the CoreSoftware (LocalServices) are urged to study sample EbrGateway code provided in the CoreSoftware distribution of an example Java implementation that handles the EbrProtocol.

We recommend the adoption of a threaded or non-blocking IO design pattern to efficiently deal with incoming messages.

An EbrGateway will only ever receive an EbrMessage with a single EbrMessagePart. If an EbrMessage contains two or more EbrMessageParts intended for one EbrGateway, the MultiPartEbrMessage will always be split up into single part EbrMessages (by the EbrNode software) before reaching your EbrGateway.

One of the first tasks of your Gateway will be to determine the target EbrService requested (X-Ebr-Service EbrMessagePartHeader) and to invoke an appropriate process to handle the request. This might mean dynamic loading of a Java class (as shown in the sample EbrGateway), calling an internal subroutine, forwarding the message onto another application, etc.

Communication Protocol

The EbrProtocol is based on standard TCP/IP socket transmission of EbrMessages.

To signal that is has finished sending information, an EbrClient will shutdown the output stream of the connected socket. The connected server must reply using the same socket connection and close the socket after completion of writing a reply EbrMessage.

Every EbrMessage request must always result in a synchronous reply, even if that reply is simply an acknowledgement that the "final" EbrMessage reply will be delivered asynchronously at a later date.

See also: EbrMessageFormat, EbrNode

Comments / Feedback


Your post will appear before this form in chronological order (newest at bottom)

----- Revision r1.7 - 24 Oct 2003 - 12:48 GMT - MartinWood
Copyright © 1999-2003 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback.